package ws;


public class MainTest {

	public static void main(String[] args) {
		//apenas para configurar o banco
		//Session session = DB.getSession();
//		MainTest test = new MainTest();
//		test.getAllLines();
//		test.test(86);
		new Service().getLinesTerminal(-3.737012, -38.571775, -3.736905, -38.530533);
	}
	
	private void getAllLines() {
		System.out.println(new Service().getAllLines());
//		String url = "http://www.etufor.ce.gov.br/sit_web/itinerarios.aspx";
//		try {
//			Document doc = Jsoup.connect(url).data("cmbTipoConsulta","2").
//					data("__EVENTTARGET","").data("__EVENTARGUMENT","").
//					data("txtLin","").data("btnPesq","Pesquisar").post();
//			Elements select = doc.select("#cmbLinhas");
//			Element linhas = select.first();
//			for (Node linha : linhas.childNodes())
//				if(linha.attr("value") != "")
//					System.out.println(linha.attr("value") + " - " + linha.childNodes());
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
	}

	private void test(int i) {
		try {
			System.out.println("\nRota: " + new Service().getRoute(i));
//			srv.extractLineRoute(i);
		} catch (Exception e) {
			System.out.println("Falha ao conectar: " + e.getMessage());
		}
	}

}
